#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 10;

//1838	[蓝桥杯][2015年第六届真题]广场舞


//点
struct Point
{
    int x, y;
};
//线
struct Line
{
    Point p1, p2;
};
//存取列分割线与多边形交点的纵坐标
struct node_y
{
    double yl, yr;
};

Point point[maxn];
Line line[maxn];
node_y pre[maxn];
int n;
//求分割线与指定的边的交点纵坐标
double gety(double x, Line l)
{
    double y, x1, y1, x2, y2;
    x1 = l.p1.x, y1 = l.p1.y, x2 = l.p2.x, y2 = l.p2.y;
    y = (y2 - y1) * (x - x1) / (x2 - x1) + y1;
    return y;
}
//对交点排序
bool cmp(node_y n1, node_y n2)
{
    return n1.yl < n2.yl;
}

int solve()
{
    int res, cnt, minn, maxx, l, r, i, j;
    minn = 1000, maxx = -1000;
    //求出x值的最小值和最大值
    for (i = 0; i < n; i++)
    {
        minn = min(minn, point[i].x), maxx = max(maxx, point[i].x);
    }
    res = 0;
    //从左到右依次遍历分割线,每次循环有两条分割线确定一列
    for (i = minn + 1; i <= maxx; i++)
    {
        cnt = 0;
        for (j = 0; j < n; j++)//遍历多边形每一条边
        {
            l = line[j].p1.x, r = line[j].p2.x;
            if (i-1>=l && i <= r)
            {
                //存下每条边交点的纵坐标对
                pre[cnt].yl = gety(i - 1, line[j]);
                pre[cnt].yr = gety(i, line[j]);
                cnt++;
            }
        }
        sort(pre, pre + cnt, cmp);//排序
        for (j = 0; j < cnt / 2; j++)
        {
            //两两一组
            l = int(ceil(max(pre[2 * j].yl, pre[2 * j].yr)));//最大者向上取整
            r = int(floor(min(pre[2 * j + 1].yl, pre[2 * j + 1].yr)));//最小者向下取整
            if (l < r)
                res += (r - l);
        }
    }
    return res;
}

int main()
{
    int i, ans;
    scanf("%d", &n);
    for (i = 0; i < n; i++)
    {
        scanf("%d%d", &point[i].x, &point[i].y);
    }
    for (i = 0; i < n; i++)
    {
        line[i].p1 = point[i], line[i].p2 = point[(i + 1) % n];
        if (line[i].p1.x > line[i].p2.x)
        {
            swap(line[i].p1, line[i].p2);//统一是第一个端点为左侧端点
        }
    }
    printf("%d\n", solve());
    return 0;
}